﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace Mes.Model
{
    public class Tag
    {
        public long id { get; set; }

        /// <summary>
        /// 设备代码
        /// </summary>
        public string DeviceCode { get; set; }

        [Required(ErrorMessage = "{0} 必须填写")]
        [DisplayName("变量")]
        public string TagFullName { get; set; }
        [DisplayName("变量描述")]
        public string TagDesc { get; set; }
        [Required(ErrorMessage = "{0} 必须填写")]
        [DisplayName("数据类型")]
        public string DataType { get; set; }
        [DisplayName("值")]
        public string Value { get; set; }

        [DisplayName("更新时间间隔")]
        public int ChangeInterval { get; set; } = 500;

        public DateTime? LastupdateTime { get; set; }
        /// <summary>
        /// 配方标识(0:不是配方参数 1: 值配方参数 2:布尔配方参数 True 为手动 False为自动 3: 布尔配方参数True 为正， False为 负)
        /// </summary>
        public int? ParamFlag { get; set; }

        /// <summary>
        /// 是否有效
        /// </summary>
        public int? ValidFlag { get; set; }

        /// <summary>
        /// TRUE时的值
        /// </summary>

        public string EnabledText { get; set; }

        /// <summary>
        /// False时的值
        /// </summary>

        public string DisabledText { get; set; }

        /// <summary>
        ///  保存句柄
        /// </summary>
        public int? ParamHandle { get; set; }
    }
    
}
